package cm.com.carlamanda.domain;

import java.io.Serializable;

public class Page implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1137432721243935938L;

    private int page;
    private int pageSize;
    private int totalCount;
    private int totalPage;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalCount) {
        this.totalPage = totalCount % page == 0 ? totalCount / page : (totalCount / page + 1);
    }

    public int getStartPos() {
        return pageSize * (page - 1) + 1;
    }

    public int getEndPos() {
        return pageSize * page;
    }

}
